<?php
/**
 * Created by PhpStorm.
 * Login: 曹旺
 * Date: 2018-03-14
 * Time: 12:42
 */

namespace app\index\validate;

use think\Validate;

class Login extends Validate
{
    //登录验证
    protected $rule = [
        'phone' => 'require|number|length:11',
        'password' => 'require|length:8,18',
        'email' => 'email',
    ];
    protected $message = [
        'phone.require' => '密码必须',
        'password.require' => '密码必须',
        'password.length' => '密码为8-18位',
        'phone.number' => '手机号必须为数字',
        'phone.length' => '手机号必须为11位',
        'email.email' => '邮箱格式错误',


    ];
    protected $scene = [
        'edit' => ['phone', 'password']
    ];
}